<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="icon" href="{:config('web.cdn')}/favicon.ico">
    <title>{$article.title}_{:config('web.web_title')}</title>
    <meta name="keywords" content="">
    <meta name="description" content="{if $article.description}{$article.description}{else/}{$article.title}{/if}">
    {include file="public:head"}
</head>
<body>
{include file="public:header_nav" /}

<!--面包屑导航 S-->
<div class="layui-fluid layui-hide-xs mianbaoxie" id="mianbaoxie">
    <div class="layui-container">
        <div class="layui-row">
            <a href="javascript:;">当前位置:</a>
            <a href="/">首页></a>
            <a href="{:url('Index/index',['cid'=>$article.cate.id])}">{$article.cate.name}></a>
            <a href="javascript:;">{:htmlspecialchars_decode($article.title)}</a>
        </div>
    </div>
</div>
<!--面包屑导航 E-->
<style>
    .list_title{
        text-align: left;
    }
    .content p{
        font-size: 20px;
        color: #484848;
        text-indent: 2rem;
        line-height: 190%;
        padding: 10px 0 20px;
    }
</style>
<div class="clear layui-hide-xs"></div>
<div class="layui-container">
    <div class="layui-row layui-col-space10">
        <!--文章详细开始-->
        <div class="detail_container  layui-col-md9 layui-col-xs12">
            <h1 style="{$article.title_style}" class="text_al">
                {:htmlspecialchars_decode($article.title)}
            </h1>
            {block name="info"}
            <div class="date_hits">
                <div class="layui-col-md3 layui-col-xs12">
                    <a href="{:request()->domain()}{:url('u/index',['id'=>$article.userinfo.id])}">
                        {if $article.userinfo.headimgurl}
                        <img alt="头像" title="头像" class="layadmin-homepage-pad-img w60" src="{$article.userinfo.headimgurl}" width="96" height="96">
                        {else /}
                        <img alt="头像" title="头像" class="layadmin-homepage-pad-img w60" src="https://micuer.com/data/upload/avatar/20200409/155cb7926416fc42a859a6dd8636bab1.jpeg" width="96" height="96">
                        {/if}
                        {$article.author}
                    </a>
                </div>
                <div class="layui-col-md3 layui-hide-xs">
                    发布于:{$article['add_time']}
                </div>
                <div class="layui-col-md3 layui-hide-xs hot_mobile">
                    <i title="热度" class="layui-icon layui-icon-light"></i>{$article.hits} 人参与
                </div>
            </div>
            <hr class="layui-hide-xs">
            {/block}
            <div class="content">
                {block name="content"}{/block}
                <!-- 软件下载隐藏域开始 -->
                {if condition="$order"}
                <style type="text/css">
                    .layui-field-box a{color: #FFF; margin-right: 15px; margin-bottom: 15px;}
                    .detail_container .content a{color: #FFF}
                </style>
                <div style="height: 45px; width: 100%"></div>
                <fieldset class="layui-elem-field">
                    <legend><span style="color:">软件下载链接</span></legend>
                    <div class="layui-field-box">
                        <a href="javascript:;" onclick="" class="button button-raised button-caution" ><i class="layui-icon">&#xe601;</i>您已购买过({$article.score}积分)</a>
                        <a href="JavaScript:;" onclick="how_down();" class="button button-raised button-royal"><i class="layui-icon">&#xe607;</i>如何下载</a>
                        <a href="javascript:;" onclick="get_score()" class="button button-raised button-caution"><i class="layui-icon">&#xe629;</i>积分获取攻略</a>
                        <div class="hidden_con">
                            <br>
                            <span style="font-size: 16px;">软件下载地址</span><br>
                            <span style="font-size: 22px;">{$article.hidden_info}</span>
                            <h5>请复制上述链接到浏览器的地址栏并按下回车，再输入密码即可获取！</h5>
                        </div>
                        <br>
                        <span style="color:#999;">
			    	下载说明：本站软件全部都是由个收集，绝对无毒无公害！如若有侵权或，请联系qq571031767进行删除！ <br>
			    	软件1群：209183654 &nbsp;&nbsp;&nbsp;  2群：524440238&nbsp;&nbsp;&nbsp;   3群：397053211&nbsp;&nbsp;&nbsp;   4群：684245561
			    </span>
                    </div>
                </fieldset>
                {else /}
                {if condition="$article['hidden_info']"}
                <style type="text/css">
                    .layui-field-box a{color: #FFF; margin-right: 15px; margin-bottom: 15px;}
                    .detail_container .content a{color: #FFF}
                </style>
                <div style="height: 45px; width: 100%"></div>
                <fieldset class="layui-elem-field">
                    <legend><span style="color:">软件下载链接</span></legend>
                    <div class="layui-field-box">
                        <a href="javascript:;" onclick="get_a_order({$article.id},{$article.score});" class="layui-btn" ><i class="layui-icon">&#xe601;</i>点击下载({$article.score}积分)</a>
                        <a href="JavaScript:;" onclick="how_down();" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe607;</i>如何下载</a>
                        <a href="javascript:;" onclick="get_score()" class="layui-btn layui-btn-warm"><i class="layui-icon">&#xe629;</i>积分获取攻略</a>
                        <div class="hidden_con">
                        </div>
                        <br>
                        <span style="color:#999;">
					    	下载说明：本站软件全部都是由个收集，绝对无毒无公害！如若有侵权或，请联系qq571031767进行删除！ <br>
					    	软件1群：209183654 &nbsp;&nbsp;&nbsp;  2群：524440238&nbsp;&nbsp;&nbsp;   3群：397053211&nbsp;&nbsp;&nbsp;   4群：684245561
					    </span>
                    </div>
                </fieldset>
                {/if}
                {/if}
                <div class="layui-hide-xs">
                    注:原创不易,转载请注明出处( <a style="color: #00a8c6" href="{:request()->domain()}{:request()->url()}">{:request()->domain()}{:request()->url()}</a> )
                </div>
            </div>
            {if $ad}
            <div style="position: relative">
                <a href="{$ad.url}" target="_blank">
                    <img src="{:img_thumber($ad.img)}" alt="">
                    <b class="ad_tips">广告</b>
                </a>
            </div>
            <div class="clear"></div>
            {/if}
            <div class="option">
                <a href="javascript:;" onclick="like({$article.id},this)">优秀(<span>{$article.like}</span>)<i class="layui-icon layui-icon-praise" style="color: red"></i></a>
                <a href="javascript:;" onclick="unlike({$article.id},this)"><i class="layui-icon layui-icon-tread"></i>鄙视(<span>{$article.unlike}</span>)</a>
            </div>
            <div class="keywords layui-hide-xs">
                <p>米醋儿 micuer.com</p>
            </div>
            {if session('index_user.username') == 'admin'}
            <div class="layui-col-md12 layui-col-xs12 tac">
                <div class="clear"></div>
                <button onclick="change_content_is_md(0,{$article.id})" type="button" class="layui-btn layui-btn-radius layui-btn-normal">富文本型文章</button>
                <button onclick="change_content_is_md(1,{$article.id})" type="button" class="layui-btn layui-btn-radius layui-btn-warm">MD类型文章</button>
                <div class="clear"></div>
            </div>
            {/if}
            <div class="prev_next">
                <div class="prev">上一篇：
                    {if $pre_article}
                    <a href="{:url('article/read',array('id'=>$pre_article['id']))}">{$pre_article.title}</a>
                    {else/}
                    <a href="{:request()->domain()}">
                        返回首页
                    </a>
                    {/if}
                </div>
                <div class="next">下一篇：
                    {if $next_article}
                    <a href="{:url('article/read',array('id'=>$next_article['id']))}">
                        {$next_article.title}
                    </a>
                    {else/}
                    <a href="{:request()->domain()}">
                        返回首页
                    </a>
                    {/if}
                </div>
                <div class="clear"></div>
            </div>
        </div>
        <!--文章详细结束-->
        {block name="right"}

        <!--作者信息开始  文章右侧-->
        <div class="layui-col-md3  layui-hide-xs" id="userinfo" style="margin-top: -7px">
            <div class="layadmin-homepage-panel layadmin-homepage-shadow">
                <div class="layui-card text-center">
                    <div class="layui-card-body">
                        <div class="layadmin-homepage-pad-ver">
                            <a href="{:request()->domain()}{:url('u/index',['id'=>$article.userinfo.id])}">
                                {if $article.userinfo.headimgurl}
                                <img class="layadmin-homepage-pad-img" src="{$article.userinfo.headimgurl}" width="96" height="96">
                                {else /}
                                <img class="layadmin-homepage-pad-img" src="https://micuer.com/data/upload/avatar/20200409/155cb7926416fc42a859a6dd8636bab1.jpeg" width="96" height="96">
                                {/if}
                            </a>
                        </div>
                        <h4 class="layadmin-homepage-font">{$article.userinfo.nickname}</h4>
                        <p class="layadmin-homepage-min-font">{:config('web.web_title')}会员</p>
                        <button class="layui-btn layui-btn-fluid" onclick="follow('{$article.userinfo.id}','{:url('U/follow')}')">跟随</button>
                        {if $index_user.is_admin == 1 || $index_user.id == $article.uid }
                        {if $article.model_id ==1}
                        {php}$url = url('Uarticle/edit',['id'=>$article['id']]); {/php}
                        {/if}
                        {if $article.model_id ==5}
                        {php}$url = url('News/create',['id'=>$article['id']]); {/php}
                        {/if}
                        <a  style="margin:15px;" href="{if(isset($url))}{$url}{/if}" class="layui-btn layui-btn-primary layui-btn-sm">
                            <i class="layui-icon"></i>修改当前文章
                        </a>
                        {/if}
                    </div>
                </div>
                <p class="layadmin-homepage-about">
                    关于我
                </p>
                <ul class="layadmin-homepage-list-group">
                    <li class="list-group-item"><i class="layui-icon layui-icon-location"></i>{$article.userinfo.address|default="西安"}</li>
                    <li class="list-group-item">
                        <a href="{:request()->domain()}{:url('u/index',['id'=>$article.userinfo.id])}" class="color"><i class="layui-icon layui-icon-snowflake"></i>
                            <span style="word-wrap:break-word;">
                        {:request()->domain()}{:url('u/index',['id'=>$article.userinfo.id])}
                    </span>
                        </a>
                    </li>
                </ul>
                <div class="layadmin-homepage-pad-hor">
                    <mdall>
                        {$article.userinfo.intro|default="米醋儿网优秀发文作者"}
                    </mdall>
                </div>
                <div class="clear layui-hide-xs"></div>
            </div>
        </div>

        <div class="layui-col-md3 layui-col-xs12" id="jiu">
            {include file="widget/widget_ad" /}
        </div>

        <div class="about_list layui-col-md9 layui-col-xs12" id="xiangguan">
            <h3>相关推荐</h3>
            <ol class="page_right_list  ">
                {volist name="$list" id="new_list"}
                <li><a href="{:url('article/read',array('id'=>$new_list['id']))}">{$new_list.title}</a><span class="hits"> {$new_list.hits} ℃ </span></li>
                {/volist}
            </ol>
        </div>
        <!--作者信息结束-->
        <div class="clear layui-hide-xs"></div>
        {/block}
        <!--留言板块开始-->
        <div class="mseeageBox detail_container   layui-col-md9 layui-hide-xs">
            <h5>给我留言</h5>
            <textarea id="demo" style="display: none;"></textarea>
            <div class="layui-row layui-col-space10 cm_box">
                <?php if(!session('index_user')):?>
                <div class="layui-col-xs6 layui-col-sm3 layui-col-md3">
                    <input type="text" name="nickname" required lay-verify="required" placeholder="昵称" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-col-xs6 layui-col-sm3 layui-col-md3">
                    <input type="email" name="email" required lay-verify="required" placeholder="邮箱" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-col-xs6 layui-col-sm3 layui-col-md3">
                    <input type="text" name="url" required lay-verify="required" placeholder="网址" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-col-xs6 layui-col-sm3 layui-col-md3 ">
                    <button type="button" class="layui-btn fr" id="comment_submit">
                        <?php if(session('index_user')):?>
                        提交
                        <?php else:?>
                        访客留言
                        <?php endif;?>
                    </button>
                </div>
                <?php else:?>
                <div class="layui-col-xs6 layui-col-sm3 layui-col-md3"> &nbsp;</div>
                <div class="layui-col-xs6 layui-col-sm3 layui-col-md3"> &nbsp;</div>
                <div class="layui-col-xs6 layui-col-sm3 layui-col-md3"> &nbsp;</div>
                <div class="layui-col-xs6 layui-col-sm3 layui-col-md3 ">
                    <button type="button" class="layui-btn fr" id="comment_submit">
                        <?php if(session('index_user')):?>
                        提交
                        <?php else:?>
                        访客留言
                        <?php endif;?>
                    </button>
                </div>
                <?php endif;?>
            </div>
            <h5>最新留言</h5>
            <hr>
            {notempty name="$comment"}
            <div class="comment">
                {foreach $comment as $v}
                <div class="item">
                    <div class="left">
                        {if $v.userinfo.headimgurl}
                        <img src="{$v.userinfo.headimgurl}" alt="{$v.userinfo.nickname}">
                        {else /}
                        <img src="/public/static/images/head.png" alt="{$v.userinfo.nickname}">
                        {/if}
                    </div>
                    <div class="right">
                        <div class="ctitle">
                            {if $v.nickname}
                            <a class="nickname" href="javascript:;">{$v.nickname}</a>
                            {else /}
                            <a class="nickname"  href="javascript:;">{$v.userinfo.nickname}</a>
                            {/if}
                            <span>
                            {$v.create_time|date="Y-m-d H:i"}
                         </span>
                        </div>
                        <div class="comment">
                            {:htmlspecialchars_decode($v.content)}
                        </div>
                    </div>
                </div>
                {/foreach}
            </div>
            {else /}
            <div class="empty">
                快来留下你的脚印吧~
            </div>
            {/notempty}
        </div>
        <!--留言板块结束-->
    </div>
    <!-- 文章 结束 -->
</div>
<script>
    var id = '{$article.id}';
</script>
{include file="public/footer"}
<script>
    layui.use('layedit', function(){
        var layedit = layui.layedit;
        var index = layedit.build('demo',{
            height: 180 //设置编辑器高度
            ,tool: [ 'face']
        }); //建立编辑器
        layedit.sync(index)
        //留言提交
        $("#comment_submit").click(function (e) {
            var content=layedit.getContent(index);
            if(!id){
                alert("id没有设置");
                return false;
            }
            if(!content){
                alert("请输入留言内容");
                return false;
            }
            console.log("eeeeeeeeeeeeeeeeeeeeee")
            var url = "{:url('Comment/save')}"
            var post_data = {
                content:content,
                id:id
                ,nickname:$("input[name=nickname]").val()
                ,email:$("input[name=email]").val()
            };
            $.post(url,post_data,function (res) {
                if(res.code == 200){
                    alert("留言成功，审核后将会显示");
                    layedit.render()
                }else {
                    alert("未登录或留言暂时不可用");
                }
            })
        })
    });
    function how_down(){
        layer.open({
            title:'下载方法',
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['420px', '240px'], //宽高
            content: '<div style="padding: 15px;">购买之后，会出现一个百度网盘的下载链家！其中包含了链接个密码！我们打来浏览器，将上述链接复制到浏览器地址栏，按下回车！会出现一个输入密码的页面，再输入我们的四位数密码！即可看到我分享的软件或者是素材了！</div>'
        });
    }
    function get_score(){
        layer.open({
            title:'积分攻略',
            type: 1,
            skin: 'layui-layer-rim', //加上边框
            area: ['420px', '240px'], //宽高
            content: '<div style="padding: 15px;">积分下载资源！大部分资源都是0积分！注册即可获得积分！对于0积分的资源，大家只要注册账号即可兑换了！</div>'
        });
    }
    //购买文章隐藏的
    function get_a_order(id,score){
        var url = "{:url('ajax_buy_items')}";
        $.post(url,{id:id,score:score},function(e){
            if(e.status ==1 ){
                layer.msg(e.msg, {icon: 1});
                $('.hidden_con').html(e.data);
            }else {
                layer.msg(e.msg, {icon: 0});
            }
        },'json');
    }
    //修改文章是否为md的文章
    function change_content_is_md(type,contentid) {
        var url = "{:url('change_content_is_md')}";
        $.post(url,{type:type,contentid:contentid},function(e){
            if(e.code ==200 ){
                success(e.msg)
            }else {
                error(e.msg)
            }
        },'json');
    }
</script>
<!-- 软件下载隐藏域结束 -->
</body>
</html>